<template>
    <div idm-ctrl="idm_module" :id="moduleObject.id" :idm-ctrl-id="moduleObject.id" ref="module_ref" class="IHeaderBar_app">
        <div class="IHeaderBar_app_main flex_between">
            <div class="IHeaderBar_app_left">
                <span>{{ propData.logoText }}</span>
            </div>
            <div class="IHeaderBar_app_right flex_end">
                <div class="search_block flex_end">
                    <div v-for="(item,index) in search_list" :key="index" class="search_list flex_start">
                        <div v-if="item.showLabel" class="label">{{ item.label }}</div>
                        <div class="select_box" :style="getSearchStyle(item)">
                            <a-select v-model="item.value" @change="e => handleChange(e,item)" :size="propData.size" allowClear>
                                <a-select-option v-for="(item1,index1) in item.option_list" :value="item1.value" :key="index1">
                                    {{ item1.label }}
                                </a-select-option>
                            </a-select>
                        </div>
                    </div>
                </div>
                <div @click="clickBack" v-if="propData.showBack" class="back_block">
                    <img :src="getBackImgSrc()">
                </div>
            </div>
        </div>
        <div v-if="propData.showDragContainer" class="drag_container fsl-region-element" :idm-ctrl-id="moduleObject.id" idm-container-index="1">
      
        </div>
    </div>
</template>
  
<script>
import {debounce} from '../utils'
export default {
    name: 'IHeaderBar',
    data() {
        return {
            moduleObject: {},
            propData: this.$root.propData.compositeAttr || {
                logoText: "效能中心",
                showBack: true,
                searchList: [
                    // {
                    //     key: 'text',
                    //     showLabel: false,
                    //     width: '100px',
                    //     dataSourceType: '1',
                    //     dataStatic: "[{ lable: '上海大数据中心', value: '1' },{ lable: '上海港区', value: '2' }]"
                    // },
                    // {
                    //     key: 'text',
                    //     showLabel: false,
                    //     width: '140px',
                    //     dataSourceType: '1',
                    //     dataStatic: "[{ lable: '上海大数据中心', value: '1' },{ lable: '上海港区', value: '2' }]"
                    // }
                ],
                showDragContainer: true
            },
            search_list: [],
            form_data: {},
            moduleHeight: '',
        }
    },
    props: {
    },
    watch: {
        'propData.searchList':{
            handler(value,old) {
                if ( value && value.length ) {
                    this.search_list = JSON.parse(JSON.stringify(value))
                } else {
                    this.search_list = [];
                }
                this.makeSelectOptionData()
                this.getSelectDefaultValue()
            },
            deep: true
        },
        'form_data':{
            handler(){
                this.postMessage()
            },
            deep:true
        }
    },
    created() {
        this.moduleObject = this.$root.moduleObject;
        this.convertAttrToStyleObject();
        if ( this.propData.searchList && this.propData.searchList.length ) {
            this.search_list = JSON.parse(JSON.stringify(this.propData.searchList))
        } else {
            this.search_list = [];
        }
        this.makeSelectOptionData()
        this.getSelectDefaultValue()
        this.$nextTick(() => {
            this.resizeContentWrapperHeight();
        });
    },
    methods: {
        getSearchStyle(item) {
            let styleObject = {};
            if ( item.width ) {
                styleObject['width'] = item.width
            }
            return styleObject
        },
        getSelectDefaultValue() {
            let searchList = this.search_list;
            for( let i = 0,maxi = searchList.length;i < maxi;i++ ) {
                if ( searchList[i].defaultValue !== 0 && (!searchList[i].defaultValue) && searchList[i].dataSourceType == '1' && searchList[i].option_list && searchList[i].option_list[0] ) {
                    this.$set(searchList[i],'value',searchList[i].option_list[0].value)
                    this.$set(this.form_data,searchList[i].key,searchList[i].option_list[0].value)
                }
            }
        },

        clickBack() {
            let that = this;
            if(this.moduleObject.env=="develop"){
                return;
            }
            //获取所有的URL参数、页面ID（pageId）、以及所有组件的返回值（用范围值去调用IDM提供的方法取出所有的组件值）
            let urlObject = window.IDM.url.queryObject(),
            pageId = window.IDM.broadcast&&window.IDM.broadcast.pageModule?window.IDM.broadcast.pageModule.id:"";
            
            var clickFunctionBack = this.propData.clickFunctionBack;
            clickFunctionBack && clickFunctionBack.forEach(item=>{
                    window[item.name]&&window[item.name].call(this,{
                    urlData:urlObject,
                    pageId,
                    customParam:item.param,
                    _this:this
                });
            })
        },
        handleChange(e,item) {
            // item.defaultValue = e;
            this.$set(this.form_data,item.key,e)
        },
        postMessage:debounce(function() {
            if ( (!this.propData.linkageDemandPageModule) || (!this.propData.linkageDemandPageModule.length) ) {
                return
            }
            console.log('发送消息-linkageDemand',this.form_data)
            var moduleIdArray = [];
            this.propData.linkageDemandPageModule.forEach(item=>{moduleIdArray.push(item.moduleId)});
            this.sendBroadcastMessage({
                type: "linkageDemand",
                message: this.form_data,
                rangeModule: moduleIdArray,
                messageKey: this.propData.messageKey,
            })
            // 给页面接口发送消息
            this.sendBroadcastMessage({
                type: "linkMessageObject",
                message: this.form_data,
                messageKey: this.propData.messageKey,
            })
        },200),
        makeSelectOptionData() {
            if ( (!this.search_list) || !this.search_list.length ) {
                return
            }
            let searchList = this.search_list;
            console.log('searchList------------',searchList)
            for( let i = 0,maxi = searchList.length;i < maxi;i++ ) {
                if ( searchList[i].dataSourceType == '1' ) {
                    this.$set(searchList[i],'option_list',eval('(' + searchList[i].dataStatic + ')'))
                } else if ( searchList[i].dataSourceType == '2' && searchList[i].dataSource && searchList[i].dataSource[0] ) {
                    console.log('12',searchList[i].dataSource)
                    this.getSelectOptionData(searchList[i].dataSource[0].id,i,searchList[i])
                }
            }
        },
        getSelectOptionData(id,index,item) {
            let that = this;
            IDM.datasource.request(id,{
                moduleObject:this.moduleObject,
                param:{
                    selectRuleId: this.propData.selectRuleId
                }
            },function(res){
                that.$set(item,'option_list',res)
                if ( item.defaultValue !== 0 && (!item.defaultValue) && res && res[0] ) {
                    console.log('defaultValue',res[0].value)
                    that.$set(item,'value',res[0].value)
                    that.$set(that.form_data,item.key,res[0].value)
                } else {
                    const defaultItem = res.find(item => item.isDefault);
                    if (defaultItem) {
                        that.$set(item,'value',defaultItem.value)
                        that.$set(that.form_data,item.key,defaultItem.value)
                    }
                }
            },function(error){
                //这里是请求失败的返回结果
            })
        },
        getBackImgSrc() {
            if ( this.propData.backImgSrc ) {
                return IDM.url.getWebPath(this.propData.backImgSrc)
            } else {
                return IDM.url.getModuleAssetsWebPath(require('../assets/back.png'),this.moduleObject)
            }
        },
        /**
         * 提供父级组件调用的刷新prop数据组件
         */
        propDataWatchHandle(propData) {
            this.propData = propData.compositeAttr || {};
            this.convertAttrToStyleObject();
            this.$nextTick(function() {
                this.resizeContentWrapperHeight();
            });
        },
        convertThemeListAttrToStyleObject() {
            const themeList = this.propData.themeList;
            if ( (!themeList) || !themeList.length ) {
                return
            }
            const themeNamePrefix = IDM.setting && IDM.setting.applications && IDM.setting.applications.themeNamePrefix ? IDM.setting.applications.themeNamePrefix : "idm-theme-";
            for (var i = 0; i < themeList.length; i++) {
                var item = themeList[i];
                
                if(item.key!=IDM.theme.getCurrentThemeInfo()){
                    //此处比对是不渲染输出不用的样式，如果页面会刷新就可以把此处放开
                    continue;
                }
                let borderObject = {
                    'border-color': item.mainColor ? item.mainColor.hex8 : "",
                }
                let fontObject = {
                    'color': item.mainColor ? item.mainColor.hex8 : "",
                }
                let fontBorder = {
                    'border-color': item.mainColor ? item.mainColor.hex8 : "",
                    'color': item.mainColor ? item.mainColor.hex8 : "",
                }
                IDM.setStyleToPageHead( "." + themeNamePrefix + item.key + " #" + (this.moduleObject.packageid || "module_demo") + " .ant-select-selection:hover", borderObject );
                IDM.setStyleToPageHead( "." + themeNamePrefix + item.key + " #" + (this.moduleObject.packageid || "module_demo") + " .ant-select-focused .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active", borderObject );
                IDM.setStyleToPageHead( "." + themeNamePrefix + item.key + " #" + (this.moduleObject.packageid || "module_demo") + " .IHeaderBar_app_left", fontBorder );
                IDM.setStyleToPageHead( "." + themeNamePrefix + item.key + " #" + (this.moduleObject.packageid || "module_demo") + " .ant-select-selection:hover .action", fontObject );
            }
        },
        /** * 把属性转换成样式对象 */
        convertAttrToStyleObjectLogo() {
            var styleObject = {};
            for (const key in this.propData) {
                if (this.propData.hasOwnProperty.call(this.propData, key)) {
                    const element = this.propData[key];
                    if (!element && element !== false && element != 0) {
                        continue;
                    }
                    switch (key) {
                        case "widthLogo":
                            styleObject['width'] = element;
                            break;
                        case "heightLogo":
                            styleObject['height'] = element;
                            break;
                        case "bgColorLogo":
                            if (element && element.hex8) {
                                styleObject["background-color"] = element.hex8;
                            }
                            break;
                        case "bgImgUrlLogo":
                            styleObject["background-image"] = `url(${window.IDM.url.getWebPath(element)})`;
                            break;
                        case "fontLogo":
                            IDM.style.setFontStyle(styleObject,element,true)
                            break;
                        case "boxLogo":
                            IDM.style.setBoxStyle(styleObject,element)
                            break;
                        case "borderLogo":
                            IDM.style.setBorderStyle(styleObject,element)
                            break
                    }
                }
            }
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .IHeaderBar_app_left', styleObject);
        },
        convertAttrToStyleObjectSelect() {
            var styleObjectSearchList = {};
            var styleObjectLabel = {};
            var styleObjectSelectBox = {};
            var styleObjectSelectInput = {};
            var styleObjectSelectInputFont = {};
            var styleObjectBorderColor = {};
            var styleObjectIcon = {};
            for (const key in this.propData) {
                if (this.propData.hasOwnProperty.call(this.propData, key)) {
                    const element = this.propData[key];
                    if (!element && element !== false && element != 0) {
                        continue;
                    }
                    switch (key) {
                        case "marginLeftSearch":
                            styleObjectSearchList['margin-left'] = element;
                            break;
                        case "fontLabel":
                            IDM.style.setFontStyle(styleObjectLabel,element)
                            break;
                        case "boxLabel":
                            IDM.style.setBoxStyle(styleObjectLabel,element)
                            break;
                        case "widthSearch":
                            styleObjectSelectBox['width'] = element;
                            break;
                        case "heightSearch":
                            styleObjectSelectBox['height'] = element;
                            styleObjectSelectInputFont['line-height'] = element;
                            break;
                        case "fontInput":
                            IDM.style.setFontStyle(styleObjectSelectInputFont,element)
                            break;
                        case "borderSearchBorder":
                            IDM.style.setBorderStyle(styleObjectSelectInput,element)
                            break;
                        case "borderSearchBg":
                            if (element && element.hex8) {
                                styleObjectSelectInput["background-color"] = element.hex8;
                            }
                            break;
                        case "borderSearchHover":
                            if (element && element.hex8) {
                                styleObjectBorderColor["border-color"] = element.hex8 + ' !important';
                            }
                            break;
                        case "fontInputIcon":
                            IDM.style.setFontStyle(styleObjectIcon,element,true)
                        
                    }
                }
            }
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list', styleObjectSearchList);
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list .label', styleObjectLabel);
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list .select_box', styleObjectSelectBox);
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list .select_box', styleObjectSelectBox);
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list .ant-select-selection', styleObjectSelectInput);
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list .ant-select-selection-selected-value', styleObjectSelectInputFont);

            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list .ant-select-selection .anticon', styleObjectIcon);
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .search_list .ant-select-selection:hover', styleObjectBorderColor);
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .ant-select-focused .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active', styleObjectBorderColor);
        },
        convertAttrToStyleObjectBack() {
            var styleObject = {};
            for (const key in this.propData) {
                if (this.propData.hasOwnProperty.call(this.propData, key)) {
                    const element = this.propData[key];
                    if (!element && element !== false && element != 0) {
                        continue;
                    }
                    switch (key) {
                        case "widthBack":
                            styleObject['width'] = element;
                            break;
                        case "heightBack":
                            styleObject['height'] = element;
                            break;
                        case "boxBack":
                            IDM.style.setBoxStyle(styleObject,element)
                            break;
                    }
                }
            }
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .IHeaderBar_app_right .back_block', styleObject);
        },
        convertAttrToStyleObjectTopContainer() {
            var styleObject = {};
            for (const key in this.propData) {
                if (this.propData.hasOwnProperty.call(this.propData, key)) {
                    const element = this.propData[key];
                    if (!element && element !== false && element != 0) {
                        continue;
                    }
                    switch (key) {
                        case "widthTopContainer":
                            styleObject['width'] = element;
                            break;
                        case "heightTopContainer":
                            styleObject['height'] = element;
                            break;
                        case "bgColorTopContainer":
                            if (element && element.hex8) {
                                styleObject["background-color"] = element.hex8;
                            }
                            break;
                        case "bgImgUrlTopContainer":
                            styleObject["background-image"] = `url(${window.IDM.url.getWebPath(element)})`;
                            break;
                        case "borderTopContainer":
                            IDM.style.setBorderStyle(styleObject,element)
                            break;
                        case "boxTopContainer":
                            IDM.style.setBoxStyle(styleObject,element)
                            break;
                    }
                }
            }
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .IHeaderBar_app_main', styleObject);
        },
        convertAttrToStyleObjectBottomContainer() {
            var styleObject = {};
            for (const key in this.propData) {
                if (this.propData.hasOwnProperty.call(this.propData, key)) {
                    const element = this.propData[key];
                    if (!element && element !== false && element != 0) {
                        continue;
                    }
                    switch (key) {
                        case "widthBottomContainer":
                            styleObject['width'] = element;
                            break;
                        case "heightBottomContainer":
                            styleObject['height'] = element;
                            break;
                        case "boxBottomContainer":
                            IDM.style.setBoxStyle(styleObject,element)
                            break
                    }
                }
            }
            window.IDM.setStyleToPageHead(this.moduleObject.id + ' .drag_container', styleObject);
        },
        convertAttrToStyleObject() {
            this.convertAttrToStyleObjectLogo()
            this.convertAttrToStyleObjectSelect()
            this.convertAttrToStyleObjectBack()
            this.convertThemeListAttrToStyleObject()
            this.convertAttrToStyleObjectTopContainer()
            this.convertAttrToStyleObjectBottomContainer()
            var styleObject = {};
            if (this.propData.bgSize && this.propData.bgSize == "custom") {
                styleObject["background-size"] = (this.propData.bgSizeWidth ? this.propData.bgSizeWidth.inputVal + this.propData.bgSizeWidth.selectVal : "auto") + " " + (this.propData.bgSizeHeight ? this.propData.bgSizeHeight.inputVal + this.propData.bgSizeHeight.selectVal : "auto")
            } else if (this.propData.bgSize) {
                styleObject["background-size"] = this.propData.bgSize;
            }
            if (this.propData.positionX && this.propData.positionX.inputVal) {
                styleObject["background-position-x"] = this.propData.positionX.inputVal + this.propData.positionX.selectVal;
            }
            if (this.propData.positionY && this.propData.positionY.inputVal) {
                styleObject["background-position-y"] = this.propData.positionY.inputVal + this.propData.positionY.selectVal;
            }
            for (const key in this.propData) {
                if (this.propData.hasOwnProperty.call(this.propData, key)) {
                    const element = this.propData[key];
                    if (!element && element !== false && element != 0) {
                        continue;
                    }
                    switch (key) {
                        case "width":
                            styleObject[key] = element;
                            break;
                        case "height":
                            if ( this.propData.HeightType == 'adaptive' && this.moduleHeight ) {
                                styleObject[key] = this.moduleHeight + 'px';
                            } else {
                                styleObject[key] = element;
                            }
                            break;
                        case "bgColor":
                            if (element && element.hex8) {
                                styleObject["background-color"] = element.hex8;
                            }
                            break;
                        case "boxShadow":
                            styleObject['box-shadow'] = element;
                            break
                        case "box":
                            IDM.style.setBoxStyle(styleObject,element)
                            break;
                        case "bgImgUrl":
                            styleObject["background-image"] = `url(${window.IDM.url.getWebPath(element)})`;
                            break;
                        case "positionX":
                            //背景横向偏移

                            break;
                        case "positionY":
                            //背景纵向偏移

                            break;
                        case "bgRepeat":
                            //平铺模式
                            styleObject["background-repeat"] = element;
                            break;
                        case "bgAttachment":
                            //背景模式
                            styleObject["background-attachment"] = element;
                            break;
                        case "border":
                            IDM.style.setBorderStyle(styleObject,element)
                            break;
                        case "font":
                            IDM.style.setFontStyle(styleObject,element)
                            break;
                    }
                }
            }
            window.IDM.setStyleToPageHead(this.moduleObject.id, styleObject);
        },
        /**
         * 通用的url参数对象
         * 所有地址的url参数转换
         */
        commonParam() {
            let urlObject = IDM.url.queryObject();
            var params = {
                pageId:
                    window.IDM.broadcast && window.IDM.broadcast.pageModule
                        ? window.IDM.broadcast.pageModule.id
                        : "",
                urlData: JSON.stringify(urlObject),
            };
            return params;
        },
        
        /** * 通用的获取表达式匹配后的结果 */
        getExpressData(dataName, dataFiled, resultData) {
            //给defaultValue设置dataFiled的值
            var _defaultVal = undefined;
            if (dataFiled) {
                var filedExp = dataFiled;
                filedExp =
                    dataName +
                    (filedExp.startsWiths("[") ? "" : ".") +
                    filedExp;
                var dataObject = { IDM: window.IDM };
                dataObject[dataName] = resultData;
                _defaultVal = window.IDM.express.replace.call(
                    this,
                    "@[" + filedExp + "]",
                    dataObject
                );
            }
            //对结果进行再次函数自定义
            if (this.propData.customFunction && this.propData.customFunction.length > 0) {
                var params = this.commonParam();
                var resValue = "";
                try {
                    resValue = window[this.propData.customFunction[0].name] && window[this.propData.customFunction[0].name].call(this, {
                        ...params,
                        ...this.propData.customFunction[0].param,
                        moduleObject: this.moduleObject,
                        expressData: _defaultVal, interfaceData: resultData
                    });
                } catch (error) {
                }
                _defaultVal = resValue;
            }

            return _defaultVal;
        },
        resizeContentWrapperHeight(wrapperHeight) {
            let moduleHeight = this.propData.HeightType == 'adaptive' ? $('#' + this.moduleObject.packageid) .parents('.fsl-region-element') .height() : this.propData.height;
            if (this.propData.HeightType == 'adaptive' && (wrapperHeight || moduleHeight)) {
                //自适应父级容器
                moduleHeight = wrapperHeight || moduleHeight;

                //如果自适应则要减去上margin和下margin(因为margin、padding百分比都是相对父级宽度，所以要计算出实际的宽度值)
                //父级宽度值未知的，因为组件的宽度是100%显示的
                //所以计算公式为：(当前组件的宽度+左右margin实际数值)/(100-左右margin百分比总和)*100=实际宽度
                let iAttrArray = ['marginLeftVal', 'marginRightVal'];
                let marginNumber = 0,
                marginRatio = 0;
                iAttrArray.forEach(item => {
                    if ( this.propData.box && this.propData.box[item] && this.propData.box[item].indexOf('%') > -1 ) {
                        //用宽度计算出实际的px
                        marginRatio += parseFloat(this.propData.box[item].replace('%', ''));
                    } else if (this.propData.box && this.propData.box[item]) {
                        marginNumber += parseFloat(this.propData.box[item].replace('px', ''));
                    }
                });
                let module_width = this.$refs.module_ref.offsetWidth;
                //实际的100%的宽度
                const module_width_100 = ((module_width + marginNumber) / (100 - marginRatio)) * 100;

                let moduleTBMarginNumber = 0;
                iAttrArray = ['marginTopVal', 'marginBottomVal'];
                iAttrArray.forEach(item => {
                    if (this.propData.box && this.propData.box[item]) {
                        if (this.propData.box[item].indexOf('%') > -1) {
                        //用宽度计算出实际的px
                            moduleTBMarginNumber = moduleTBMarginNumber + (parseFloat(this.propData.box[item].replace('%', '')) / 100) * module_width_100;
                        } else {
                            moduleTBMarginNumber = moduleTBMarginNumber + parseFloat(this.propData.box[item].replace('px', ''));
                        }
                    }
                });
                moduleHeight = moduleHeight - moduleTBMarginNumber;
            }
            this.moduleHeight = moduleHeight;
            this.convertAttrToStyleObject()
        },
        /**
         * 组件通信：接收消息的方法
         * @param {
         *  type:"发送消息的时候定义的类型，这里可以自己用来要具体做什么，统一规定的type：linkageResult（组件联动传结果值）、linkageDemand（组件联动传需求值）、linkageReload（联动组件重新加载）
         * 、linkageOpenDialog（打开弹窗）、linkageCloseDialog（关闭弹窗）、linkageShowModule（显示组件）、linkageHideModule（隐藏组件）、linkageResetDefaultValue（重置默认值）"
         *  message:{发送的时候传输的消息对象数据}
         *  messageKey:"消息数据的key值，代表数据类型是什么，常用于表单交互上，比如通过这个key判断是什么数据"
         *  isAcross:如果为true则代表发送来源是其他页面的组件，默认为false
         * } object 
         */
        receiveBroadcastMessage(object) {
            console.log("组件收到消息", object)
            if (object && object.type == "regionResize" && object.message && object.message.gridEleTarget) {
                let gridEleTarget = object.message.gridEleTarget;
                if (gridEleTarget && gridEleTarget.offsetHeight) {
                    this.$nextTick(() => {
                        if ( this.propData.HeightType == 'adaptive' && gridEleTarget.offsetHeight ) {
                            this.resizeContentWrapperHeight(gridEleTarget.offsetHeight)
                        } 
                    })
                }
            }
        },
        /**
         * 组件通信：发送消息的方法
         * @param {
         *  type:"自己定义的，统一规定的type：linkageResult（组件联动传结果值）、linkageDemand（组件联动传需求值）、linkageReload（联动组件重新加载）
         * 、linkageOpenDialog（打开弹窗）、linkageCloseDialog（关闭弹窗）、linkageShowModule（显示组件）、linkageHideModule（隐藏组件）、linkageResetDefaultValue（重置默认值）",
         *  message:{实际的消息对象},
         *  rangeModule:"为空发送给全部，根据配置的属性中设定的值（值的内容是组件的packageid数组），不取子表的，比如直接 this.$root.propData.compositeAttr["attrKey"]（注意attrKey是属性中定义的bindKey）,这里的格式为：['1','2']"",
         *  className:"指定的组件类型，比如只给待办组件发送，然后再去过滤上面的值"
         *  globalSend:如果为true则全站发送消息，注意全站rangeModule是无效的，只有className才有效，默认为false
         * } object 
         */
        sendBroadcastMessage(object) {
            window.IDM.broadcast && window.IDM.broadcast.send(object);
        },
        /**
         * 交互功能：设置组件的上下文内容值
         * @param {
         *  type:"定义的类型，已知类型：pageCommonInterface（页面统一接口返回值）、"
         *  key:"数据key标识，页面每个接口设置的数据集名称，方便识别获取自己需要的数据"
         *  data:"数据集，内容为：字符串 or 数组 or 对象"
         * }
         */
        setContextValue(object) {
            console.log("统一接口设置的值", object);
        }
    }
}
</script>
<style lang="scss" scoped>
.IHeaderBar_app{
    .IHeaderBar_app_main{
        background-repeat: no-repeat;
        background-size: 100% 100%;
    }
    .IHeaderBar_app_left{
        background-repeat: no-repeat;
        background-size: 100%;
        box-sizing: border-box;
    }
    .IHeaderBar_app_right{
        .select_box{
            width: 180px;
            // height: 60px;
            
            .ant-select-selection:hover{
                // border-color: red;
            }
        }
        .label{
            white-space: nowrap;
        }
        .back_block{
            width: 38px;
            height: 38px;
            margin-left: 40px;
            img{
                width: 100%;
                height: 100%;
            }
        }

    }
    .fsl-region-element {
        border: none!important;
        background-color: transparent!important;
        cursor: auto!important;
    }
}
</style>
<style lang="scss">
.IHeaderBar_app{
    &>.drag_container{
        &>div{
            height: 100%;
        }
    }
    .ant-select-selection:hover{
        // border-color: red;
    }
    .ant-select-focused .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active{
        // border-color: red;
        box-shadow: none;
    }
    .ant-select-selection-selected-value{
        // color: red;
    }
    .ant-select-selection__clear{
        background: none !important;
    }
    .ant-select{
        width: 100%;
        height: 100%;
        .ant-select-selection--single{
            height: 100%;
            .ant-select-selection__rendered{
                height: 100%;
            }
        }
    }
    
}
</style>